// Super Shotgun (Doom II)

ACTOR IDMSuperShotgun : IDMWeapon
{
	Weapon.SelectionOrder 400
	Weapon.Sisterweapon "SuperShotgunLevel2"
	//Weapon.PreferredSkin "SSGMarine"
	Weapon.AmmoUse 2
	Weapon.AmmoGive 8
	Weapon.AmmoType "IDMShell"
	Weapon.Kickback 200
	Inventory.PickupMessage "Super Shotgun! (Slot 3)"
	Obituary "%o was splattered by %k's Super Shotgun."
	Tag "Super Shotgun"
	Decal BulletChip
	Damagetype "Bullet"
	AttackSound "weapons/sshotf"
	+WEAPON.NOLMS
	States
	{
	Ready:
	  SHT2 A 1 A_WeaponReady
      Loop
	Deselect:
      TNT1 A 0 A_Lower
      TNT1 A 0 A_Lower
	  SHT2 A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      TNT1 A 0 A_Raise
      SHT2 A 1 A_Raise
      Loop
	Fire:
	  TNT1 A 0 A_JumpIfInventory("DuelItem",1,"DuelFire")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	  TNT1 A 0 A_GunFlash
      SHT2 A 4 Bright Offset(0,38) A_FireBullets(11.2, 7.1, 60, 5, "IDMShotPuff")
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
      TNT1 A 0 A_GunFlash
	  SHT2 A 4 Bright Offset(0,38) A_FireBullets(11.2, 7.1, 60, 5, "ExtremeShotPuff")
	  Goto FireEnd
	DuelFire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "DuelQuad")
	  TNT1 A 0 A_GunFlash
      SHT2 A 4 Bright Offset(0,38) A_FireBullets(11.2, 7.1, 50, 5, "IDMShotPuff")
	  Goto FireEnd
	DuelQuad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
      TNT1 A 0 A_GunFlash
	  SHT2 A 4 Bright Offset(0,38) A_FireBullets(11.2, 7.1, 50, 5, "ExtremeShotPuff")
	FireEnd:
      SHT2 A 2 Bright Offset(0,35)
      SHT2 A 1 Bright Offset(0,33)
      SHT2 B 7 A_CheckReload
      SHT2 C 7
      SHT2 D 7 A_OpenShotgun2
      SHT2 E 7
      SHT2 F 7 A_LoadShotgun2
      SHT2 G 6
      SHT2 H 6 A_CloseShotgun2
      SHT2 A 5 A_ReFire("Hold")
      Goto Ready
	Hold:
	  SHT2 A 3
	  Goto Fire
	Flash:
      SHT2 J 4 Bright A_Light2
      SHT2 I 2 Bright A_Light1
      Goto LightDone
	Spawn:
      SGN2 A -1 Bright
      Stop
	}
}

ACTOR SuperShotgunLevel2 : IDMSuperShotgun
{
  Weapon.Sisterweapon "IDMSuperShotgun"
  +POWERED_UP
  States
  {
  Ready:
    SHT3 A 1 A_WeaponReady
    Loop
  Deselect:
    SHT3 A 0 A_Lower
    SHT3 A 0 A_Lower
	SHT3 A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    SHT3 A 0 A_Raise
    SHT3 A 0 A_Raise
    SHT3 A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_JumpIfInventory("DuelItem",1,"DuelFire")
	SHT3 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
	SHT3 A 0 A_GunFlash
    SHT3 A 4 Bright Offset(0,38) A_FireBullets(16.8, 7.1, 180, 5, "IDMShotPuff")
	Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT3 A 0 A_GunFlash
	SHT3 A 4 Bright Offset(0,38) A_FireBullets(16.8, 7.1, 180, 5, "ExtremeShotPuff")
	Goto FireEnd
  DuelFire:
	SHT3 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "DuelQuad")
	SHT3 A 0 A_GunFlash
    SHT3 A 4 Bright Offset(0,38) A_FireBullets(16.8, 7.1, 150, 5, "IDMShotPuff")
	Goto FireEnd
  DuelQuad:
	TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO,1)
	SHT3 A 0 A_GunFlash
	SHT3 A 4 Bright Offset(0,38) A_FireBullets(16.8, 7.1, 150, 5, "ExtremeShotPuff")
  FireEnd:
    SHT3 A 2 Bright Offset(0,35)
    SHT3 A 1 Bright Offset(0,33)
    SHT3 B 7 A_CheckReload
    SHT3 C 7
    SHT3 D 7 A_OpenShotgun2
    SHT3 E 7
    SHT3 F 7 A_LoadShotgun2
    SHT3 G 6
    SHT3 H 6 A_CloseShotgun2
    SHT3 A 5 A_ReFire("Hold")
    Goto Ready
  Hold:
    SHT3 A 3
    Goto Fire
  Flash:
    SHT3 J 4 Bright A_Light1
    SHT3 I 2 Bright A_Light2
    Goto LightDone
  }
}


/* SSG for the Buckshot modifier. Doesn't inherit from the standard SSG, because
   the player would have two SSGs in their inventory for some reason.
   Also the ACS script doesn't switch the weapon to the Buckshot SSG serverside.
   Making the Buckshot SSG in a separate weapon definition fixes this.*/

ACTOR BuckshotSuperShotgun : IDMWeapon replaces SuperShotgun
{
	Weapon.SelectionOrder 1
	//Weapon.PreferredSkin "SSGMarine"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.AmmoType none
	Weapon.Kickback 200
	Inventory.PickupMessage "Super Shotgun!"
	Obituary "%o was splattered by %k's Super Shotgun."
	Tag "Super Shotgun (Buckshot md.)"
	Decal BulletChip
	Damagetype "Bullet"
	AttackSound "weapons/sshotf"
	+WEAPON.NOLMS
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	States
	{
	Ready:
	  SHT2 A 1 A_WeaponReady
      Loop
	Deselect:
      TNT1 A 0 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      Loop
	Fire:
	  TNT1 A 0 A_GunFlash
      SHT2 A 4 Bright Offset(0,38) A_FireBullets(11.2, 7.1, 60, 5, "IDMShotPuff")
	  SHT2 A 2 Bright Offset(0,35)
	  SHT2 A 1 Bright Offset(0,33)
      SHT2 B 7 A_CheckReload
      SHT2 C 7
      SHT2 D 7 A_OpenShotgun2
      SHT2 E 7
      SHT2 F 7 A_LoadShotgun2
      SHT2 G 6
      SHT2 H 6 A_CloseShotgun2
      SHT2 A 5 A_ReFire("Hold")
      Goto Ready
	Hold:
	  SHT2 A 3
	  Goto Fire
	Flash:
      SHT2 J 4 Bright A_Light2
      SHT2 I 2 Bright A_Light1
      Goto LightDone
	}
}